home *** CD-ROM | disk | FTP | other *** search
/ World of Video / World of Video.iso / gfxprograms / 3dprograms / rayshade-4.0 / etc / rsconvert / makefile.sh < prev    next >
Makefile  |  1995-02-13  |  2KB  |  64 lines

  1. case $CONFIG in
  2. '')
  3.     if test ! -f config.sh; then
  4.     ln ../config.sh . || \
  5.     ln ../../config.sh . || \
  6.     ln ../../../config.sh . || \
  7.     (echo "Can't find config.sh."; exit 1)
  8.     fi
  9.     . config.sh
  10.     ;;
  11. esac
  12. : This forces SH files to create target in same directory as SH file.
  13. : This is so that make depend always knows where to find SH derivatives.
  14. case "$0" in
  15. */*) cd `expr X$0 : 'X\(.*\)/'` ;;
  16. esac
  17. echo "Extracting etc/rsconvert/Makefile (with variable substitutions)"
  18. : This section of the file will have variable substitutions done on it.
  19. : Move anything that needs config subs from !NO!SUBS! section to !GROK!THIS!.
  20. : Protect any dollar signs and backticks that you do not want interpreted
  21. : by putting a backslash in front.  You may delete these comments.
  22. $spitshell >Makefile <<!GROK!THIS!
  23. OPTIMIZE = $optimize
  24. CCFLAGS = $ccflags $large
  25. CC = $cc
  26. MKDEP = $mkdep
  27. YACC = $yacc
  28. LEX = $lex
  29. !GROK!THIS!
  30.  
  31. : In the following dollars and backticks do not need the extra backslash.
  32. $spitshell >>Makefile <<'!NO!SUBS!'
  33. LIBRAYDIR = ../../libray
  34. INCLUDE = -I$(LIBRAYDIR) -I../../
  35. CFLAGS = $(CCFLAGS) $(INCLUDE) $(OPTIMIZE)
  36. LIBS =
  37. YFLAGS = -d
  38.  
  39. CFILES = main.c yacc.c lex.c
  40. OBJS = $(CFILES:.c=.o)
  41. DEPENDSRC = main.c yacc.y lex.l
  42.  
  43. rsconvert: $(OBJS)
  44.     $(CC) $(CFLAGS) -o rsconvert $(OBJS) $(LIBS)
  45.  
  46. depend:
  47.     (sed '/^# DO NOT DELETE THIS LINE/q' Makefile && \
  48.      $(MKDEP) $(DEPENDSRC) | sed 's/: \.\//: /; /\/usr\/include/d' \
  49.     ) >Makefile.new
  50.     cp Makefile Makefile.bak
  51.     cp Makefile.new Makefile
  52.     rm -f Makefile.new
  53.  
  54. clean:
  55.     /bin/rm -f y.tab.h $(OBJS) lex.c
  56.  
  57. realclean:
  58.     rm -f $(OBJS) lex.c y.tab.h core Makefile Makefile.bak rsconvert
  59.  
  60. # DO NOT DELETE THIS LINE
  61. !NO!SUBS!
  62. chmod 755 Makefile
  63. $eunicefix Makefile
  64.